﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<WebPortal.Models.ViewModel.GoodsModelList>" %>

<asp:Content ID="CSS" ContentPlaceHolderID="StylesContainer" runat="server">
    <link href="../../Content/Auth.css" rel="stylesheet" type="text/css" />
</asp:Content>

<asp:Content ID="JS" ContentPlaceHolderID="ScriptContainer" runat="server">
    <script type="text/javascript" src="../../Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.validate.min.js"></script>
    <script type="text/javascript" src="../../Scripts/authorization.js"></script>
    <script type="text/javascript" src="../../Scripts/basket.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.md5.js"></script>
    <script type="text/javascript" src="../../Scripts/cookie.js"></script>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Category search
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div class="LoginWindow">
    <form action=".">
    <fieldset>
        <div class="ErrorMessage">Wrong email or password</div>
        <label for="Email">Email</label>
        <input class="Email" name="Email" type="text" />
        <label for="Password">Password</label>
        <input class="Password" name="Password" type="password" />
        <input class="Submit" type="submit" value="Login" />
    </fieldset>
    </form>
</div>

<div class="RegisterWindow">
    <form action=".">
    <fieldset>
        <div class="ErrorMessage">Fields are not correct</div>
        <label for="Email">Email</label>
        <input class="Email" type="text" name="Email" />
        <label for="Password">Password</label>
        <input class="Password" type="password" name="Password" />
        <label for="ConfirmPassword">Confirm Password</label>
        <input class="ConfirmPassword" type="password" name="ConfirmPassword" />

        <label for="Captcha">Enter code</label>
        <img src="/Auth/Captcha" />
        <input type="text" class="Captcha" name="Captcha" />
        <input class="Submit" type="submit" value="Register" />
    </fieldset>
    </form>
</div>

<h3>Categories:</h3>
<div>
    <% for (int i = 0; i < Model.categories.Count; i++)
       { %>
       <a class="cat-item" href="/Main/Search?id=<%:Model.categories[i].CategoryID%>">
            <%:Model.categories[i].Name%>
       </a>
    <% } %>
</div>

<h3 class="cat-head">Goods:</h3>
<% if (Model.goods.Count > 0)
   { %>
    <% for (int i = 0; i < Model.goods.Count; i++)
       { %>

       <div class="item">
            <div><img src="/Content/Img/<%:Model.goods[i].Picture%>" alt="" /></div>
            <div><%: Model.goods[i].Name%></div>
            <div class="descr"><%:Model.goods[i].Description%></div>
            <div><a href="/Main/Search?id=<%:Model.goods[i].CatID%>"><%:Model.goods[i].CatName%></a></div>
            <% if (ViewData["IsRegistredUser"].Equals(true))
               { %>
                <div class="select" id="<%:Model.goods[i].GoodID%>">Select</div>
            <% } %>
       </div>

    <% } %>
<% }
   else
   { %>
   <h1>Nothing found for this query</h1>
   <% } %>
</asp:Content>
